﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="ApplicationEdit.aspx.cs"
    Inherits="WebAppAuthAdmin.App.ApplicationEdit" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <link href="/Styles/GridStyle.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Detalle de Aplicaci&oacute;n
    </h2>
    <div class="editionContainerFilter">
        <p>
            <span class="title">C&oacute;digo:</span>
            <asp:TextBox ID="txtCodigo" runat="server" CssClass="input inputlong"></asp:TextBox>
        </p>
        <div class="clear">
        </div>
        <p>
            <span class="title">Nombre:</span>
            <asp:TextBox ID="txtNombre" runat="server" CssClass="input inputlong"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidatorForNombre" ControlToValidate="txtNombre"
                runat="server" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
        </p>
        <div class="clear">
        </div>
        <p>
            <span class="title">Url:</span>
            <asp:TextBox ID="txtUrl" runat="server" CssClass="input inputlong"></asp:TextBox>
        </p>
        <div class="clear">
        </div>
        <p>
            <span class="title">Contacto:</span>
            <asp:TextBox ID="txtContacto" runat="server" CssClass="input inputlong"></asp:TextBox>
        </p>
        <div class="clear">
        </div>
        <p>
            <span class="title">Requiere Login sin empresa?:</span>
            <asp:CheckBox ID="chkRequireLoginSinEmpresa" runat="server" CssClass="chk" ClientIDMode="Static" />
        </p>
        <div class="clear">
        </div>
        <asp:Panel ID="pnlRequiereLoginSinEmpresa" runat="server" ClientIDMode="Static">
            <p>
                <span class="title">Dominio:</span>
                <asp:TextBox ID="txtDominio" runat="server" Text="" CssClass="input inputverylong"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtDominio"
                    runat="server" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
            </p>
            <div class="clear">
            </div>
            <p>
                <span class="title">Path de Active Directory:</span>
                <asp:TextBox ID="txtPathAd" runat="server" Text="" CssClass="input inputverylong"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtPathAd"
                    runat="server" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
            </p>
            <div class="clear">
            </div>
            <p>
                <span class="title">Usuario AD:</span>
                <asp:TextBox ID="txtUsuarioAd" runat="server" Text="" CssClass="input inputlong"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtUsuarioAd"
                    runat="server" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
            </p>
            <div class="clear">
            </div>
            <p>
                <span class="title">Password AD:</span>
                <asp:TextBox ID="txtPasswordAd" runat="server" Text="" TextMode="Password" CssClass="input inputlong"></asp:TextBox>
            </p>
            <div class="clear">
            </div>
        </asp:Panel>
    </div>
    <br />
    <asp:Panel ID="pnlDetails" runat="server">
        <h2>
            <asp:Image Width="15px" Height="15px" ID="Image1" CssClass="imgExpand" ImageUrl="/Images/icon_blockexpanded.png"
                runat="server" ClientIDMode="Static" alt="" onclick="window.AppCommonObj.toggleVisibility(this.id, 'pnlRoles');" />
            Perfiles
        </h2>
        <div class="editionContainerForGrid" id="pnlRoles">
            <asp:GridView ID="GridRoles" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"
                CssClass="editionContainerForGrid" AutoGenerateColumns="False" DataKeyNames="Id"
                Width="100%" OnRowCommand="GridRoles_RowCommand" OnRowDataBound="GridRoles_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                        Text="Button" AccessibleHeaderText="editar">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:ButtonField>
                    <asp:ButtonField ButtonType="Image" CommandName="eliminar" ImageUrl="~/Images/eliminar.png"
                        Text="Button" AccessibleHeaderText="editar">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:ButtonField>
                    <asp:BoundField DataField="Id" HeaderText="Id" Visible="false">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Name" HeaderText="Nombre">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
            <asp:LinkButton ID="lnkAgregarRole" runat="server" CssClass="guardar" OnClick="lnkAgregarRole_Click">Agregar</asp:LinkButton>
        </div>
        <br />
        <h2>
            <asp:Image Width="15px" Height="15px" ID="imgExpandResults" CssClass="imgExpand"
                ImageUrl="/Images/icon_blockexpanded.png" runat="server" ClientIDMode="Static"
                alt="" onclick="window.AppCommonObj.toggleVisibility(this.id, 'pnlOperaciones');" />
            Operaciones
        </h2>
        <div class="editionContainerForGrid" id="pnlOperaciones">
            <asp:GridView ID="GridOperaciones" runat="server" CellPadding="4" ForeColor="#333333"
                GridLines="None" CssClass="editionContainerForGrid" AutoGenerateColumns="False"
                DataKeyNames="Id" Width="100%" OnRowDataBound="GridOperaciones_RowDataBound"
                OnRowCommand="GridOperaciones_RowCommand">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                        Text="Button" AccessibleHeaderText="editar">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:ButtonField>
                    <asp:ButtonField ButtonType="Image" CommandName="eliminar" ImageUrl="~/Images/eliminar.png"
                        Text="Button" AccessibleHeaderText="eliminar">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:ButtonField>
                    <asp:BoundField DataField="Description" HeaderText="Descipción">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Name" HeaderText="Nombre">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Id" HeaderText="Id" Visible="false">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Operaciones">
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                        <HeaderTemplate>
                            <asp:Label ID="Label1" runat="server" Text="Operaciones"></asp:Label>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkRowVerRol" runat="server" CommandName="verroles" CssClass="lnkGrid">Ver perfiles que la incluyen</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
            <asp:LinkButton ID="lnkAgregarOperacion" runat="server" CssClass="guardar" OnClick="lnkAgregarOperacion_Click">Agregar</asp:LinkButton>
        </div>
        <br />
    </asp:Panel>
    <asp:LinkButton ID="lnkGuardar" runat="server" CssClass="guardar" OnClick="lnkGuardar_Click">Guardar</asp:LinkButton>
    <script type='text/javascript'>

        $(document).ready(function () {

            if (!window.AppCommonObj) {
                window.AppCommonObj = new AppCommon();
            }

            $('#chkRequireLoginSinEmpresa').change(function () {
                if ($('#chkRequireLoginSinEmpresa ').is(':checked')) {
                    $('#pnlRequiereLoginSinEmpresa').toggle(true);
                }
                else {
                    $('#pnlRequiereLoginSinEmpresa').toggle(false);
                }
            });

        });
    </script>
</asp:Content>
